package com.scwatch.ext.service.impl;

import com.scwatch.ext.domain.ClickRate;
import com.scwatch.ext.repository.ShareClickRateDao;
import com.scwatch.ext.service.ShareClickRateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author mafei
 * @Title: ShareClickRateServiceImpl
 * @ProjectName SCGC_CMS
 * @Description: TODO
 * @date 2018/9/2916:18
 */
@Service
@Transactional(readOnly = false, isolation = Isolation.DEFAULT, propagation = Propagation.REQUIRED)
public class ShareClickRateServiceImpl implements ShareClickRateService {

    @Override
    public ClickRate get(Integer id) {
        return dao.findOne(id);
    }

    @Transactional
    public ClickRate save(ClickRate bean) {
        return dao.save(bean);
    }

    @Transactional
    public ClickRate update(ClickRate bean) {
        return dao.save(bean);
    }

    @Override
    public List<ClickRate> findAll() {
        return dao.findAll();
    }

    @Autowired
    private ShareClickRateDao dao;
}
